package beans;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;
import java.util.Random;

public class BPMEvent {

	private String type;
	private String message;
	private String bpm ="100";
	
	
	public String displayMessage(String message){
		return "message is "+message;
	}

	public String getBpm() {
		return bpm;
	}

	public void setBpm(String bpm) {
		this.bpm = bpm;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getMessage() {
		return message ="xxx";
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public String getCurrentBPM(){
		
		return "Current heartbeat reading is: ";//+generateBPM();
		
	}
	/*
	public String generateBPM(){
		String temp="";
			Random r = new Random(98);
			int intVal =r.nextInt(150);
			try
			{
		     
	            File file =new File("OpFile.txt");
	            boolean b = false;
	            if(!file.exists()){
	            	b=file.createNewFile();
	            }
	            else
	            {
	            	b = true;
	            }
	              if(b)
	       		 {
	        	        
	        	        String content = "Hello xxxxxxxxxx" + System.getProperty("line.separator");
		        	    FileWriter fw = new FileWriter(file.getName(),true);
		        	    BufferedWriter bw = new BufferedWriter(fw);
		        	    bw.write(content);
		        	    bw.close();
	        	 }
	       	
	            	
	        	   
	             
			}catch(Exception e){
				System.out.println(e.getMessage());
			}
	        		
			
		return temp+intVal;
	}
	*/
}
